﻿/*
 * XCoder v3.4.2011.0316
 * 作者：nnhy/X
 * 时间：2011-04-04 11:54:06
 * 版权：版权所有 (C) 新生命开发团队 2010
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace NXCMS.CMS
{
	/// <summary>
	/// 消息
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("消息")]
	[BindTable("Message", Description = "消息", ConnName = "CMS", DbType = DatabaseType.SqlServer)]
	public partial class Message
	{
		#region 属性
		private Int32 _ID;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ID", "编号", "", "int", 10, 0, false)]
		public Int32 ID
		{
			get { return _ID; }
			set { if (OnPropertyChange("ID", value)) _ID = value; }
		}

		private String _FromUser;
		/// <summary>
		/// 来自用户
		/// </summary>
		[Description("来自用户")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(2, "FromUser", "来自用户", "", "nvarchar(50)", 0, 0, true)]
		public String FromUser
		{
			get { return _FromUser; }
			set { if (OnPropertyChange("FromUser", value)) _FromUser = value; }
		}

		private String _ToUser;
		/// <summary>
		/// 到用户
		/// </summary>
		[Description("到用户")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(3, "ToUser", "到用户", "", "nvarchar(50)", 0, 0, true)]
		public String ToUser
		{
			get { return _ToUser; }
			set { if (OnPropertyChange("ToUser", value)) _ToUser = value; }
		}

		private String _Box;
		/// <summary>
		/// 箱子
		/// </summary>
		[Description("箱子")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(4, "Box", "箱子", "", "nvarchar(10)", 0, 0, true)]
		public String Box
		{
			get { return _Box; }
			set { if (OnPropertyChange("Box", value)) _Box = value; }
		}

		private Int32 _ReadFlag;
		/// <summary>
		/// 广告标记
		/// </summary>
		[Description("广告标记")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(5, "ReadFlag", "广告标记", "", "int", 10, 0, false)]
		public Int32 ReadFlag
		{
			get { return _ReadFlag; }
			set { if (OnPropertyChange("ReadFlag", value)) _ReadFlag = value; }
		}

		private Int32 _PopFlag;
		/// <summary>
		/// 弹出标记
		/// </summary>
		[Description("弹出标记")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(6, "PopFlag", "弹出标记", "", "int", 10, 0, false)]
		public Int32 PopFlag
		{
			get { return _PopFlag; }
			set { if (OnPropertyChange("PopFlag", value)) _PopFlag = value; }
		}

		private String _Subject;
		/// <summary>
		/// 主体
		/// </summary>
		[Description("主体")]
		[DataObjectField(false, false, true, 500)]
		[BindColumn(7, "Subject", "主体", "", "nvarchar(500)", 0, 0, true)]
		public String Subject
		{
			get { return _Subject; }
			set { if (OnPropertyChange("Subject", value)) _Subject = value; }
		}

		private String _Content;
		/// <summary>
		/// 内容
		/// </summary>
		[Description("内容")]
		[DataObjectField(false, false, true, 1073741823)]
		[BindColumn(8, "Content", "内容", "", "ntext", 0, 0, true)]
		public String Content
		{
			get { return _Content; }
			set { if (OnPropertyChange("Content", value)) _Content = value; }
		}

		private DateTime _AddTime;
		/// <summary>
		/// 添加时间
		/// </summary>
		[Description("添加时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(9, "AddTime", "添加时间", "", "datetime2", 7, 0, false)]
		public DateTime AddTime
		{
			get { return _AddTime; }
			set { if (OnPropertyChange("AddTime", value)) _AddTime = value; }
		}

		private String _BackupNo;
		/// <summary>
		/// 备份编号
		/// </summary>
		[Description("备份编号")]
		[DataObjectField(false, false, true, 15)]
		[BindColumn(10, "BackupNo", "备份编号", "", "nvarchar(15)", 0, 0, true)]
		public String BackupNo
		{
			get { return _BackupNo; }
			set { if (OnPropertyChange("BackupNo", value)) _BackupNo = value; }
		}

		private String _BackupOperator;
		/// <summary>
		/// 备份操作者
		/// </summary>
		[Description("备份操作者")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(11, "BackupOperator", "备份操作者", "", "nvarchar(200)", 0, 0, true)]
		public String BackupOperator
		{
			get { return _BackupOperator; }
			set { if (OnPropertyChange("BackupOperator", value)) _BackupOperator = value; }
		}

		private DateTime _BackupTime;
		/// <summary>
		/// 备份时间
		/// </summary>
		[Description("备份时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(12, "BackupTime", "备份时间", "", "datetime2", 7, 0, false)]
		public DateTime BackupTime
		{
			get { return _BackupTime; }
			set { if (OnPropertyChange("BackupTime", value)) _BackupTime = value; }
		}

		private String _BackupMemo;
		/// <summary>
		/// 备份注释
		/// </summary>
		[Description("备份注释")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(13, "BackupMemo", "备份注释", "", "nvarchar(50)", 0, 0, true)]
		public String BackupMemo
		{
			get { return _BackupMemo; }
			set { if (OnPropertyChange("BackupMemo", value)) _BackupMemo = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "ID" : return _ID;
					case "FromUser" : return _FromUser;
					case "ToUser" : return _ToUser;
					case "Box" : return _Box;
					case "ReadFlag" : return _ReadFlag;
					case "PopFlag" : return _PopFlag;
					case "Subject" : return _Subject;
					case "Content" : return _Content;
					case "AddTime" : return _AddTime;
					case "BackupNo" : return _BackupNo;
					case "BackupOperator" : return _BackupOperator;
					case "BackupTime" : return _BackupTime;
					case "BackupMemo" : return _BackupMemo;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "ID" : _ID = Convert.ToInt32(value); break;
					case "FromUser" : _FromUser = Convert.ToString(value); break;
					case "ToUser" : _ToUser = Convert.ToString(value); break;
					case "Box" : _Box = Convert.ToString(value); break;
					case "ReadFlag" : _ReadFlag = Convert.ToInt32(value); break;
					case "PopFlag" : _PopFlag = Convert.ToInt32(value); break;
					case "Subject" : _Subject = Convert.ToString(value); break;
					case "Content" : _Content = Convert.ToString(value); break;
					case "AddTime" : _AddTime = Convert.ToDateTime(value); break;
					case "BackupNo" : _BackupNo = Convert.ToString(value); break;
					case "BackupOperator" : _BackupOperator = Convert.ToString(value); break;
					case "BackupTime" : _BackupTime = Convert.ToDateTime(value); break;
					case "BackupMemo" : _BackupMemo = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得消息字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 编号
			///</summary>
			public const String ID = "ID";

			///<summary>
			/// 来自用户
			///</summary>
			public const String FromUser = "FromUser";

			///<summary>
			/// 到用户
			///</summary>
			public const String ToUser = "ToUser";

			///<summary>
			/// 箱子
			///</summary>
			public const String Box = "Box";

			///<summary>
			/// 广告标记
			///</summary>
			public const String ReadFlag = "ReadFlag";

			///<summary>
			/// 弹出标记
			///</summary>
			public const String PopFlag = "PopFlag";

			///<summary>
			/// 主体
			///</summary>
			public const String Subject = "Subject";

			///<summary>
			/// 内容
			///</summary>
			public const String Content = "Content";

			///<summary>
			/// 添加时间
			///</summary>
			public const String AddTime = "AddTime";

			///<summary>
			/// 备份编号
			///</summary>
			public const String BackupNo = "BackupNo";

			///<summary>
			/// 备份操作者
			///</summary>
			public const String BackupOperator = "BackupOperator";

			///<summary>
			/// 备份时间
			///</summary>
			public const String BackupTime = "BackupTime";

			///<summary>
			/// 备份注释
			///</summary>
			public const String BackupMemo = "BackupMemo";
		}
		#endregion
	}
}